<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
test(function() {
  var doc = document.implementation.createDocument("http://www.w3.org/2000/svg", "SVG", null);
  var body = doc.createElementNS("http://www.w3.org/1999/xhtml", "body");
  doc.documentElement.appendChild(body);
  var svg = doc.createElementNS("http://www.w3.org/2000/svg", "svg");
  body.appendChild(svg);
  var g = doc.createElementNS("http://www.w3.org/2000/svg", "g");
  svg.appendChild(g);
  var title1 = doc.createElementNS("http://www.w3.org/1999/xhtml", "title");
  title1.textContent = "title1";
  g.appendChild(title1);
  assert_equals(doc.title,'title1');
  var title2 = doc.createElementNS("http://www.w3.org/1999/xhtml", "title");
  title2.textContent = "title2";
  svg.appendChild(title2);
  assert_equals(doc.title,'title1');
}, "Test for setting title element of inner svg document.");
</script>
